package com.joysuch.wwyt.risk.service.impl;

import cn.zlg.common.util.CollectionUtils;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.joysuch.wwyt.risk.entity.RiskItemEvalCountRecord;
import com.joysuch.wwyt.risk.entity.vo.RiskItemEvalCountRecordVo;
import com.joysuch.wwyt.risk.mapper.RiskItemEvalCountRecordMapper;
import com.joysuch.wwyt.risk.service.RiskItemEvalCountRecordService;
import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Service;

import java.util.ArrayList;
import java.util.List;

/**
 * <p>
 * 服务实现类
 * </p>
 *
 * @author zqw
 * @since 2021-12-21
 */
@Service
public class RiskItemEvalCountRecordServiceImpl extends ServiceImpl<RiskItemEvalCountRecordMapper, RiskItemEvalCountRecord> implements RiskItemEvalCountRecordService {

    @Override
    public List<RiskItemEvalCountRecord> batchCovertRiskItemEvalCountRecord(List<RiskItemEvalCountRecordVo> dataList) {
        List<RiskItemEvalCountRecord> recordList = new ArrayList<>();
        if (!CollectionUtils.isEmpty(dataList)) {
            dataList.forEach(e -> {
                RiskItemEvalCountRecord record = new RiskItemEvalCountRecord();
                BeanUtils.copyProperties(e, record);
                recordList.add(record);
            });

        }
        return recordList;
    }
}
